Socket
Socket
Sign inDemoInstall

@tkey/share-serialization

Package Overview
Dependencies
Maintainers
4
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tkey/share-serialization

TKey share serialization module


Version published
Weekly downloads
1.1K
increased by39.19%
Maintainers
4
Weekly downloads
 
Created
Source

tKey Share Serialization Module

npm version minzip

The Share Serialization Module helps you add or remove the and password as a share for tkey. This module is the part of the tKey SDK.

Installation

npm install --save @tkey/share-serialization

Initialization

Import the ShareSerializationModule class from @tkey/share-serialization
import ShareSerializationModule from "@tkey/share-serialization";
Assign the ShareSerializationModule class to a variable
const shareSerializationModule = new ShareSerializationModule();

Returns

The ShareSerializationModule class returns an object with the following properties:

declare class ShareSerializationModule implements IModule {
  moduleName: string;
  tbSDK: ITKeyApi;
  constructor();
  static serializeMnemonic(share: BN): string;
  static deserializeMnemonic(share: string): BN;
  setModuleReferences(tbSDK: ITKeyApi): void;
  initialize(): Promise<void>;
  serialize(share: BN, type: string): Promise<unknown>;
  deserialize(serializedShare: unknown, type: string): Promise<BN>;
}

Usage

With the ShareSerializationModule, you've access to the following functions:

Serialize a share

serialize(share: BN, type: string)
  • share: The share to serialize.
  • type: The type of share to serialize.

Deserialize a share

deserialize(serializedShare: unknown, type: string)
Return
  • Promise<BN>: The deserialized share.

FAQs

Package last updated on 29 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc